home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 5 / BBS_HYP_ / BBS_HYP.C
C/C++ Source or Header  |  1992-07-19  |  3KB  |  117 lines

  1. /***
  2.  * BBS/HYP.c
  3.  *
  4.  * I conceived this program on a night when I was feeling particularly
  5.  * lazy.  This program will open applications for you from the keyboard
  6.  * with the touch of a key.  It will keep you from having to click 
  7.  * through massive volumes of folders in order to find the program you
  8.  * wish to use.
  9.  *
  10.  * This is a product of Dreamer's Software...
  11.  *
  12.  * This program has been run only on a Mac IIci and does not have extensive 
  13.  * error checking, but if used right I have found it to be a big help.
  14.  * I hope you can enjoy it, but if in fact it causes trouble for you I
  15.  * take no responsibility.
  16.  *
  17.  * TO USE:  Just input your pathnames and application names as is shown
  18.  * in the source code example.
  19.  *
  20.  * Please enjoy it, and if nothing more it gives you an example of the use
  21.  * of a switch statement.
  22.  *
  23.  * GEnie: J.EDWARDS38
  24.  * BBS:   GLOBAL VILLAGE BBS  (512)-476-0016  9600 DS/HST USR
  25.  ***/
  26.  
  27. #include <unix.h>
  28. #include <stdlib.h>
  29. #include <console.h>
  30.  
  31. #define NDIGITS  80
  32.  
  33. main()
  34. {
  35.     int i;
  36.     
  37.     console_options.title = "\pProgram Chooser 1";
  38.     
  39.       for(i = 0; i < 12; i++) puts(" ");
  40.       puts("              Welcome to PROGRAM CHOOSER 1!");
  41.        puts("                     a product of Dreamer's Software..");
  42.        for(i = 0; i < 12; i++) puts(" ");
  43.        
  44.        sleep(2);
  45.        
  46.        choose();
  47.  }
  48.  
  49. choose()
  50. {
  51.     char name[NDIGITS];
  52.     
  53.     
  54.  
  55.     printf("\t\tGood day! Which would you like?\n\n\n");
  56.     printf("\t\t\tWhich would you like to open?\n\n");
  57.     printf("       Miscellaneous:                            Communications:\n");
  58.     puts("       ______________                            _______________");
  59.     printf("    <H>yperCard                               <Z>term\n");
  60.     printf("    <S>econd Sight                            <W>hite Knight 11.12\n");
  61.     printf("    <C> (Think C 5.0)\n");
  62.     printf("    <3>D (Swivel 3D Professional)\n");
  63.     printf("    <U>tilities (Compaction)\n");
  64.     printf("\n\n");
  65.     printf("       Money/Word Processing\n");
  66.     puts("       _____________________\n");
  67.     printf("    <E>xcel\n");
  68.     printf("    <M>ore 3.0\n");
  69.  
  70.     puts("\t\t\tChoose 'Q' to exit program!\n");
  71.     printf("PROMPT: ");
  72.     if(!user_choose())
  73.         {
  74.             exit(EXIT_SUCCESS);
  75.         }
  76.     
  77. }
  78.  
  79. user_choose()
  80. {
  81.     while(1)
  82.         {
  83.             switch(getchar())
  84.                 {
  85.                     case 'h':
  86.                     case 'H':
  87.                         exec("T.W. 105:HyperCard:Hypercard");
  88.                     case 's':
  89.                     case 'S':
  90.                         exec("T.W. 105:BBS:Second Sight");
  91.                     case 'c':
  92.                     case 'C':
  93.                         exec("T.W. 105:Mac. Development:Think C 5.0 Folder:Think C 5.0");
  94.                     case '3':
  95.                         exec("T.W. 105:Swivel 3D:Swivel 3D¬ Professional");
  96.                     case 'z':
  97.                     case 'Z':
  98.                         exec("T.W. 105:WK Master:Comm.:ZTerm 0.9");
  99.                     case 'w':
  100.                     case 'W':
  101.                         exec("T.W. 105:WK Master:White Knight 11.12");
  102.                     case 'e':
  103.                     case 'E':
  104.                         exec("T.W. 105:MORE 3.0:Microsoft Excel");
  105.                     case 'm':
  106.                     case 'M':
  107.                         exec("T.W. 105:MORE 3.0:MORE¬ 3.0");
  108.                     case 'u':
  109.                     case 'U':
  110.                         exec("T.W. 105:MORE 3.0:Comp.Util.:Compact Pro:Compact Pro");
  111.                     case 'q':
  112.                     case 'Q':
  113.                         exit(EXIT_SUCCESS);
  114.                 }
  115.         }
  116. }     
  117.